/**
 * 
 */
package com.xbang.attendance.service;

import java.util.Date;
import java.util.List;

import com.xbang.attendance.entity.order.DeliveryOrder;
import com.xbang.attendance.entity.order.PurchaseOrder;
import com.xbang.attendance.entity.system.SysParam;
import com.xbang.attendance.utils.DeliveryJsonObject;
import com.xbang.core.service.BaseService;

import enumeration.DeliveryStatus;

/**
 * @author Administrator
 * 
 */
public interface DeliveryOrderService extends BaseService {
	

	/***
	 *  产生送货单excel文件
	 * @param webPath web路径
	 * @param templatePath 模板路径
	 * @return 文件路径
	 * @throws Exception
	 */
	String genericExcelFile(String webPath,String templatePath,String [] ids) throws Exception;
	
	/***
	 * 得到排序的类型
	 * @param code
	 * @return
	 * @throws Exception
	 */
	SysParam getParamByCode(String code)throws Exception;
	
	/**
	 * 发送邮件
	 * @param id
	 * @throws Exception
	 */
	void sendMail(String webPath,String templatePath,String [] ids)throws Exception;
	/**
	 * 保存送货单
	 * 
	 * @param pid
	 * @param maintenanceStationId
	 * @param warehouseId
	 * @param details
	 * @throws Exception
	 */
	void saveDeliveryOrder(List<DeliveryJsonObject> lists) throws Exception;

	/***
	 * 根据PO单，拿到送货单。
	 * 
	 * @param purchaseOrder
	 * @return
	 */
	DeliveryOrder getDeliveryOrderByPurchase(PurchaseOrder purchaseOrder);

	/**
	 * 查询订单和有库存的仓储
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	PurchaseOrder getOrderByKey(Integer id) throws Exception;

	/**
	 * 更新订单状态信息
	 * 
	 * @param deliveryOrder
	 *            订单
	 * @param deliveryStatus
	 *            订单状态
	 * @param updateDate
	 *            更新日期
	 * @param updater
	 *            更新人
	 */
	void updateDeliveryStatus(DeliveryOrder deliveryOrder, DeliveryStatus deliveryStatus, Date updateDate, String updater) throws Exception;

	/**
	 * 更新送货单发送状态
	 * 
	 * @param deliveryOrder
	 *            送货单
	 * @throws Exception
	 */
	void updateDeliverySendStatus(DeliveryOrder deliveryOrder) throws Exception;
	/**
	 * 根据web路径生成excel,并返回该文件的名称
	 * 
	 * @param webPath
	 *            服务器路径
	 * @return
	 * @throws Exception
	 */
	String genericExcelFile(String webPath,String [] ids) throws Exception;
	/***
	 * 导出
	 * @param webPath
	 * @param templatePath
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	//String genericExcelFile(String webPath,String [] ids) throws Exception;
	
	/**
	 * 批量修改为已经签收的状态
	 * @param ids
	 * @throws Exception
	 */
	void updateStatus(String [] ids)throws Exception;
}
